package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdvertisementRotationMapper;
import com.ruoyi.system.domain.AdvertisementRotation;
import com.ruoyi.system.service.IAdvertisementRotationService;

/**
 * 轮播广告Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-02
 */
@Service
public class AdvertisementRotationServiceImpl implements IAdvertisementRotationService 
{
    @Autowired
    private AdvertisementRotationMapper advertisementRotationMapper;

    /**
     * 查询轮播广告
     * 
     * @param id 轮播广告主键
     * @return 轮播广告
     */
    @Override
    public AdvertisementRotation selectAdvertisementRotationById(Integer id)
    {
        return advertisementRotationMapper.selectAdvertisementRotationById(id);
    }

    /**
     * 查询轮播广告列表
     * 
     * @param advertisementRotation 轮播广告
     * @return 轮播广告
     */
    @Override
    public List<AdvertisementRotation> selectAdvertisementRotationList(AdvertisementRotation advertisementRotation)
    {
        return advertisementRotationMapper.selectAdvertisementRotationList(advertisementRotation);
    }

    /**
     * 新增轮播广告
     * 
     * @param advertisementRotation 轮播广告
     * @return 结果
     */
    @Override
    public int insertAdvertisementRotation(AdvertisementRotation advertisementRotation)
    {
        advertisementRotation.setCreateTime(DateUtils.getNowDate());
        return advertisementRotationMapper.insertAdvertisementRotation(advertisementRotation);
    }

    /**
     * 修改轮播广告
     * 
     * @param advertisementRotation 轮播广告
     * @return 结果
     */
    @Override
    public int updateAdvertisementRotation(AdvertisementRotation advertisementRotation)
    {
        advertisementRotation.setUpdateTime(DateUtils.getNowDate());
        return advertisementRotationMapper.updateAdvertisementRotation(advertisementRotation);
    }

    /**
     * 批量删除轮播广告
     * 
     * @param ids 需要删除的轮播广告主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisementRotationByIds(Integer[] ids)
    {
        return advertisementRotationMapper.deleteAdvertisementRotationByIds(ids);
    }

    /**
     * 删除轮播广告信息
     * 
     * @param id 轮播广告主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisementRotationById(Integer id)
    {
        return advertisementRotationMapper.deleteAdvertisementRotationById(id);
    }
}
